package cn.gok.oop;

class Person {//类名首字母大写
    int age;//变量名首字母小写
    String sex;
    String name;
    String school;

    public void show() {//函数名首字母小写
        System.out.println(this.age + " " + this.sex + " " + this.name + " " + this.school);
    }
}

public class 类和对象 {
    public static void main(String[] args) {
        //1创建一个Person对象
        Person person = new Person();//创建对象//构造函数：person，对象名：Person是类名
        //2设置属性值
        person.age = 18;
        person.sex = "男";
        person.name = "梁金印";
        person.school = "qzd";
        //3调用方法
        person.show();
    }
}
